package nowcoder;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author shhjiang_001
 * @create 2020-06-29 14:43
 */
public class Testnk03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        sc.close();
        String[] strs = s.substring(1, s.length() - 1).split(",");
        ArrayList<Integer> list = new ArrayList<>();
        int[] ints = new int[strs.length];
        for (int i = 0; i < strs.length; i++) {
            ints[i] = Integer.parseInt(strs[i]);
        }
        int le = 0;
        int ri = 0;
        System.out.print("[");
        while (le < strs.length-1){
            if (ints[le] >= ints[ri]){
                ri++;
            }else {
                System.out.print(ri-le+",");
                le++;
                ri = le;
            }
            if (ri == strs.length){
                System.out.print(0+",");
                le++;
                ri = le;
            }
        }
        System.out.print("0]");

    }
}
